*------------------------------------------------------------------------------*
					*** FIGURE S5. DOSE-RESPONSE RELATION ***
*------------------------------------------------------------------------------*

***Macros
local depvars_tab2_turnout "turnout"
local depvars_tab2_votes "Incumbent_share Est_opp_share OtherParties_share"
local weather_controls "O3_30km_10ug temp_30km humid_rel_30km wind_speed_30km precip_30km"
local demo_econ_controls "pop_tot GDP_capita employment"
local PM10_dummies " PM10_1020 PM10_2030 PM10_30plus "  // PM10_010 reference level
local PM10_dummies_finer " PM10_510 PM10_1015 PM10_1520 PM10_2025 PM10_2530 PM10_3035 PM10_3540 PM10_4045 PM10_4550 PM10_50plus "	// PM10_05 reference category

*------------------------------------------------------------------------------*

use "${tempdata}kreise_complete_all.dta", clear

foreach x in STATTPARTEI_share SCHILL_share {
	replace `x' = 0 if `x' == .
}

*------------------------------------------------------------------------------*

*** Generate PM10 dummies
gen PM10_05 = 1 if (PM10_30km <= 5 & PM10_30km != .)
gen PM10_510 = 1 if PM10_30km > 5 & PM10_30km <= 10
gen PM10_1015 = 1 if PM10_30km > 10 & PM10_30km <= 15
gen PM10_1520 = 1 if PM10_30km > 15 & PM10_30km <= 20
gen PM10_2025 = 1 if PM10_30km > 20 & PM10_30km <= 25
gen PM10_2530 = 1 if PM10_30km > 25 & PM10_30km <= 30
gen PM10_3035 = 1 if PM10_30km > 30 & PM10_30km <= 35
gen PM10_3540 = 1 if PM10_30km > 35 & PM10_30km <= 40
gen PM10_4045 = 1 if PM10_30km > 40 & PM10_30km <= 45
gen PM10_4550 = 1 if PM10_30km > 45 & PM10_30km <= 50
gen PM10_50plus = 1 if (PM10_30km > 50 & PM10_30km != .)
foreach x in 05 510 1015 1520 2025 2530 3035 3540 4045 4550 50plus {
	replace PM10_`x' = 0 if PM10_`x' == .
}  // x

*------------------------------------------------------------------------------*

*** Label variables
label variable PM10_05 "0-5"
label variable PM10_510 "5-10"
label variable PM10_1015 "10-15"
label variable PM10_1520 "15-20"
label variable PM10_2025 "20-25"
label variable PM10_2530 "25-30"
label variable PM10_3035 "30-35"
label variable PM10_3540 "35-40"
label variable PM10_4045 "40-45"
label variable PM10_4550 "40-50"
label variable PM10_50plus ">50"

*------------------------------------------------------------------------------*	
	
***Graph

**Incumbent		
reghdfe Incumbent_share `PM10_dummies_finer' `weather_controls' `demo_econ_controls' turnout , absorb(kreis_code election_date type) vce(cluster kreis_code), if samplePM10_allcontrols == 1

coefplot, vertical drop(`weather_controls' `demo_econ_controls' turnout _cons) yline(0) ///
			labels legend(off) ytitle("Change in percentage points") xtitle("Concentration of PM10 ({&mu}g/m{sup:3})") ///
			rescale(100) graphregion(color(white)) bgcolor(white) name(inc, replace)

graph export "${outputs}figure_S5.pdf", as(pdf) replace

*------------------------------------------------------------------------------*

clear

exit
